// Widgets/Pet/PetInfoWidget/PetInfoWidget.js
//获取应用实例
const app = getApp();
const assetsAddress = app.globalData.global.assetsIp + '/' + app.globalData.global.assetsName;
Component({

  /**
   * 组件的属性列表
   */
  properties: {
    pet: {
      type: Object,
    },
    hasHealth: {
      type: Boolean,
      value: false,
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    assetsAddress: assetsAddress,
  },

  /**
   * 组件的方法列表
   */
  methods: {
    // 宠物健康信息
    goHealth(e){
      const item = e.target.dataset.item||e.currentTarget.dataset.item;
      wx.navigateTo({
        url: `/pages/Pet/PetHealthInfo/PetHealthInfo?petId=${item.id}`,
      })
    }
  }
})